class ModeratorshipsController < ResourceController
  
  def new
    @moderatorship.user_id = params[:user_id]
    flash[:error] = "That link didn't specify a user" and redirect_to :back unless @moderatorship.user
  end
  
  def create
    if @moderatorship.save
      flash[:notice] = "Successfully created moderatorship"
      redirect_to user_path(@moderatorship.user_id)
    else
      render :action => 'new'
    end
  end
  
  def destroy
    @moderatorship.destroy
    flash[:notice] = "Successfully destroyed moderatorship"
    redirect_to user_path(@moderatorship.user_id)
  end

end
